function exportData(el) {
	var element = '#'+el;
	var file = 'xls';
	var fileName = 'data';
	var columnNms = $(element).jqGrid('getGridParam', 'colNames');
	var theads = "";
	for ( var cc = 1; cc < columnNms.length -2 ; cc++) {
		
			theads = theads + "<th>" + columnNms[cc + 1] + "</th>"
	}
	theads = "<tr>" + theads + "</tr>";
	var mya = new Array();
	mya = jQuery(element).jqGrid('getDataIDs'); // Get All IDs
	var data = jQuery(element).jqGrid('getRowData', mya[0]); // Get First
	// row to
	// get the
	// labels
	// alert(data['id']);
	var colNames = new Array();
	var ii = 0;
	for ( var i in data) {
		colNames[ii++] = i;
	}

	var pageHead = "Testing Excel";
	var html = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><style script='css/text'>table.tableList_1 th {border:1px solid #a8da7f; border-bottom:2px solid #a8da7f; text-align:center; vertical-align: middle; padding:5px; background:#e4fad0;}table.tableList_1 td {border:1px solid #a8da7f; text-align: left; vertical-align: top; padding:5px;}</style></head><body><div class='pageHead_1'>"
			+ pageHead
			+ "</div><table border='"
			+ (file == 'pdf' ? '0' : '1')
			+ "' class='tableList_1 t_space' cellspacing='10' cellpadding='0'>"
			+ theads;
	// alert('len'+mya.length);
	for (i = 0; i < mya.length; i++) {
		html = html + "<tr>";
		data = jQuery(element).jqGrid('getRowData', mya[i]); // get each row
		for (j = 0; j < colNames.length; j++) {
			
				html = html + "<td>" + data[colNames[j]] + "</td>"; // output
				// each
				// column
				// as
				// tab
				// delimited
		}
		html = html + "</tr>"; // output each row with end of line

	}
	html = html + "</table></body></html>"; // end of line at the
	// end
	// alert(html);
	document.formstyle.pdfBuffer.value = html;
	document.formstyle.fileType.value = file;
	document.formstyle.fileName.value = fileName;
	document.formstyle.method = 'POST';
	document.formstyle.action = '/export'; // send
	// it to
	// server
	// which
	// will
	// open
	// this
	// contents
	// in
	// excel
	// file
	document.formstyle.target='_blank';
	document.formstyle.submit();
}
